package com.limeng.datastruts.dp;

public class Fib2 {

    private static long[] nums = new long[1000000];

    public static void main(String[] args) {
        System.out.println(fib(64));
    }

    public static long fib(int index){
        if(index<2) return index;
        if (nums[index]!=0){
            return nums[index];
        }
        nums[index] = fib(index-1)+fib(index-2);
        return nums[index];

    }
}
